<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" Content="text/html; charset=utf-8"/>

	<link rel="stylesheet" type="text/css" href="../css/header.css">
	<link rel="stylesheet" type="text/css" href="../css/footer.css">
	<link rel="stylesheet" type="text/css" href="../css/skillControl.css">
	<link rel="stylesheet" href="../res/bootstrap/css/bootstrap.min.css">
	<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.js"></script>
	<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.js"></script>

	<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
	
	
	<script src="../myUtil.js"></script>
	<script type="text/javascript" src="../js/skillControl.js"></script>

<script> 
    $(function(){
      $(".header").load("header.html"); 
	  $(".footer").load("footer.html"); 
    });
    
</script> 

</head>

<body ng-app="myModule">
<div class="container" ng-controller="MyController">
<div class="header span12"></div>
<h1>대회 구현기술관리</h1>구현기술을 추가,제거,수정하는 페이지입니다.

	<br/><br/>
	
	<div id="skillTree">
	<table class="table table-condensed" >
		<thead>
			<tr>
				<td>기술종류를 선택하세요</td>
			</tr>
		</thead>
		
		<tbody>
		<tr ng-repeat="item in skillTreeList" >
			<td ng-if="item==skillTreeModifyItem">
				<input type="text" ng-model="$parent.$parent.moSkillTree"/>
			</td>
			
			<td ng-if="!(item==skillTreeModifyItem)" ng-click="$parent.$parent.selectedTree=item; loadSkill()" >
				<span >{{item.skillTree_name}}</span>
			</td>
			
			<td ng-if="!(item==skillTreeModifyItem)"><a class="btn" ng-click="skillTreeModify($index)">수정</a> <a class="btn btn-primary" ng-click="skillTreeDelete($index)">삭제</a></td>
			<td ng-if="item==skillTreeModifyItem"><a class="btn" ng-click="skillTreeModifyComplete($index)">완료</a> <a class="btn btn-primary" ng-click="skillTreeModify($index)">취소</a></td>
		</tr>
		</tbody>
	</table>
	
	<input type="text" class="form-control"ng-model="skillTree" placeholder="추가할 기술종류를 입력하세요."/>&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-primary" ng-click="skillTreeAdd()">종류추가</a>
	
	</div>
	
	<div id="skill">
	<table  class="table table-condensed">
	<thead>
			<tr>
				<td><span ng-if="selectedTree">{{selectedTree.skillTree_name}}에 해당하는 기술 목록</span>
				<span ng-if="!selectedTree">기술종류를 선택해주세요.</span></td>
			</tr>
	</thead>
		
		<tbody>
		<tr ng-repeat="item in skillList">
			<td>
				<input type="text" ng-if="item==skillModifyItem" ng-model="$parent.$parent.moSkill"/>
				<span ng-if="!(item==skillModifyItem)">{{item.skill_name}}</span>
			</td>
			<td ng-if="!(item==skillModifyItem)"><a class="btn" ng-click="skillModify($index)">수정</a> <a class="btn btn-primary" ng-click="skillDelete($index)">삭제</a></td>
			<td ng-if="item==skillModifyItem"><a class="btn" ng-click="skillModifyComplete($index)">완료</a> <a class="btn btn-primary" ng-click="skillModify($index)">취소</a></td>
		</tr>
		
		</tbody>
	</table>
	<div ng-if="selectedTree"><input type="text" class="form-control"ng-model="$parent.skill" placeholder="추가할 기술울 입력하세요."/>&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-primary" ng-click="skillAdd()">기술추가</a></div>
</div>


<div class="footer span12"></div>
</div>
</body>
</html>